home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: Question on argv
- Date: 31 Jan 1996 15:21 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <31JAN199615214435@erich.triumf.ca>
- References: <4eoq3c$45j@usenet.ucs.indiana.edu>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4eoq3c$45j@usenet.ucs.indiana.edu>, gompa@nickel.ucs.indiana.edu (Raghu R. Gompa) writes...
- >I am writing a program in which I want to
- >retrieve the arguments argv[1] ... argv[4].
- >argv[1] .. argv[3] are strings of characters.
- >I want to use argv[4] as an integer. Can
- >I do that? and how? Thank you for your
- >help in advance. .. Raghu
-
- All the command line areguments are passed to your program as strings. Use
- your favourite method to convert the string to a number - sscanf() is portable,
- but you may also have atoi().
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-
-
-
-